﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected string GetSize(object size)
{
	string unit = " B";
	Single result = Convert.ToSingle(size);
	if (result > 1024)
	{
		result = result / 1024;
		unit = " K";
	}
	if (result > 1024)
	{
		result = result / 1024;
		unit = " M";
	}
	if (result > 1024)
	{
		result = result / 1024;
		unit = " G";
	}
	
	return result.ToString("0.00") + unit;
}
</script>
<section data-page="file_manager_list" data-title="文件管理" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>文件管理</dt>
	</dl>
	<div class="ali-tabs sub-nav" data-height-style="fill" data-event="click">
		<div class="ali-tabs-body">
			<div class="ali-tabs-panel">
				<form action="" class="search1" style="display:none"><button type="submit" class="ali-button">搜索</button></form>
				<form action="" class="add1">
					地址：
					<%If String.IsNullOrEmpty(Request.QueryString["Folder"])%>
						<input type="text" name="Folder" value="/" class="ali-input">
					<%Else%>
						<input type="text" name="Folder" value="<%=Request.QueryString["Folder"]%>" class="ali-input">
					<%EndIf%>
					<button type="button" class="ali-button" data-operation="Open">打开</button>
					<button type="button" class="ali-button" data-operation="Up">上层</button>
					<button type="button" class="ali-button" data-operation="CreateFolder">新建文件夹</button>
					文件：
					<input type="text" name="File" disabled class="ali-input">
					<a class="ali-button ali-uploader">浏览...</a>	
					<button type="submit" class="ali-button">上传</button>
					<label><input type="checkbox" name="AddWaterMark" class="ali-input">水印</label>
				</form>
				<div class="content">
					<table data-ali-widget="grid" class="grid1">
						<thead>
							<tr>
								<th>名称</th>
								<th width="80">扩展名</th>
								<th width="80">大小</th>
								<th width="140">创建时间</th>
								<th width="140">更新时间</th>
								<th width="80">属性</th>
								<th width="80">重名</th>
								<th width="80">移动</th>
								<th width="80">复制</th>
								<th width="80">压解</th>
								<th width="80">删除</th>
							</tr>
						</thead>
						<tbody>
							<ali:List ID="List" Object="FileManager" Condition="Folder=Request.QueryString['Folder']" Validate="True">
								<ali:Record>
									<tr data-id="<%=Name%>">
										<th class="system-file-list">
											<%If Convert.ToBoolean(IsFolder)%>
												<img src="<%=ImagePath%>tree/folder.gif" /><a href=""><%=Name%></a>
											<%Else%>
												<img src="<%=ImagePath%>tree/file.gif" /><a href="<%=WebPath%><%=Name%>"  target="ali-navtab"><%=Name%></a>
											<%EndIf%>
										</th>
										<td><%=Extension%></td>
										<td><%=GetSize(Size)%></td>
										<td><%=CreateTime%></td>
										<td><%=UpdateTime%></td>
										<td><%=Attribute%></td>
										<td><a href="" class="ali-button" data-operation="Rename">重名</a></td>
										<td><a href="" class="ali-button" data-operation="Move">移动</a></td>
										<td><a href="" class="ali-button" data-operation="Copy">复制</a></td>
										<td>
											<%If Convert.ToString(Extension) == ".zip"%>
												<a href="" class="ali-button" data-operation="Decompress">解压</a>
											<%Else%>
												<a href="" class="ali-button" data-operation="Compress">压缩</a>
											<%EndIf%>
										</td>
										<td><a href="" class="ali-button" data-operation="Delete">删除</a></td>
									</tr>
								</ali:Record>
								<tr>
									<td colspan="2">占用空间：</td>
									<td colspan="9"></td>
								</tr>
							</ali:List>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="ali-tabs-bottom"><b></b></div>
	</div>
</section>